using System;
using Sinacor.Infra.Common;
using System.Collections.Generic;
using Sinacor.Service.Infra.AuthorizationService.Service.DataContract.Request;
using Sinacor.Service.Infra.AuthorizationService.BusinessEntity;

namespace Sinacor.Service.Infra.AuthorizationService.Service.ServiceImplementation.Translator
{
    /// <summary>
    /// Classe tradutora entre objetos UpdatePolicyRequest e Policy
    /// </summary>
    public class DeleteBehaviorPolicyRequestToBehaviorPolicy :
            BaseTranslator<BusinessEntity.BehaviorPolicy, DataContract.Request.DeleteBehaviorPolicyRequest,
            List<BusinessEntity.BehaviorPolicy>, List<DataContract.Request.DeleteBehaviorPolicyRequest>>
    {
        public override BusinessEntity.BehaviorPolicy Translate(DataContract.Request.DeleteBehaviorPolicyRequest from)
        {
            if (from == null)
                return null;

            BusinessEntity.BehaviorPolicy to = new BusinessEntity.BehaviorPolicy();

            to.CompanyId = from.CompanyId;
            to.RoleId = from.RoleId;
            to.AssociatedPolicy = new BusinessEntity.Policy(); 
            to.AssociatedPolicy.PolicyId = from.PolicyId;

            return to;
        }



    }
}

